# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
inherit versionator webapp

DESCRIPTION="Web based (PHP Script) photo album viewer/creator."
HOMEPAGE="http://gallery.sourceforge.net/"
LICENSE="GPL-2"
MY_P=${P/_/-}
MY_P=${MY_P/beta/beta-}
SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"

KEYWORDS="~x86 ~ppc ~sparc ~alpha ~hppa ~amd64"
IUSE="postgres"
RDEPEND=">=net-www/apache-1.3.24-r1
	>=dev-php/mod_php-4.1.0
	|| (
		postgres? ( >=dev-db/postgresql-7.0 )
		>=dev-db/mysql-3.0
	)"

MY_PV="$(get_major_version)"
S=${WORKDIR}/${PN}${MY_PV}

src_install() {
	webapp_src_preinst

	# docs
	dohtml README.html
	rm -f README.html
	for file in docs/*; do
		dodoc ${file}
		rm -f ${file}
	done
	rmdir docs

	# webapp files
	touch config.php
	cp -R . ${D}/${MY_HTDOCSDIR}

	# config files
	webapp_configfile ${MY_HTDOCSDIR}/config.php

	# owned files
	webapp_serverowned ${MY_HTDOCSDIR}/config.php

	webapp_postinst_txt en ${FILESDIR}/postinstall-en-${MY_PV}.txt
	webapp_src_install
}
